package secondBrush.string;

import javax.swing.plaf.ComponentUI;

public class E07Leetcode459 {
    public boolean repeatedSubstringPattern(String s) {
        int length = s.length();
        for (int i = 0; i < length / 2; i++) {
            int left = i;
            int right = 1;
            String str = s.substring(left, right);
            while (right < length ) {
                if (str.equals(s.substring(left, right))) {
                    if (right == length) {
                        return true;
                    }
                    left++;
                    right++;
                } else {
                    break;
                }

            }


        }
        return false;


    }

    public static void main(String[] args) {
        String s = "asdhj";
        String substring = s.substring(0, 3);
        System.out.println(substring);
    }
}
